import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView/HomeView.vue'
import loogin from '../views/Login.vue'
import editMenu from '../views/menuConfig/EditMenu.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      components: {
        default: loogin,
        main: loogin
      }
    },
    {
      path: '/home',
      name: 'home',
      components: {
        default: HomeView,
        main: HomeView
      },
      children: [
        {
          path: '/menu_config',
          name: 'menu_config',
          props: true,
          components: {
            page: editMenu
          }
        }
      ]
    }
  ]
})

export default router
